<?php
 

/* Check if this is a valid include */
if (!defined('IN_SCRIPT')) {die($hdlang['attempt']);}

$getressql = "SELECT name FROM `hd_residences` WHERE ";
 
$getressql .= hd_myResid();

$residence = hd_isNumber($_GET['residence']) or $residence=0;
if ($residence) {$getressql .= "`id`='$residence' ";}
	 
$result=mysql_query($getressql);
$resi=mysql_fetch_object($result);
$res= $resi->name;
echo $res;

$sql="select * from stud_approved where res='$res'and connected=0 order by room_no asc";

$result=mysql_query($sql);  
$all = hd_dbNumRows($result);
echo "<h3 align=center>There ".$all." connections to be given</h3>"; 

?>
<form name="form1" action="process_connection.php" method="POST">

<div align="center">
<center>
<table border="0" width="750" cellspacing="1" cellpadding="3" class="white">
<tr>
 
<td class="admin_white">&nbsp;</td>
<td class="admin_white"> <?php echo "NAME:"; ?> </td>
 <td class="admin_white" align="center"> <?php echo "REGNO"; ?> </td>
<td class="admin_white"> <?php echo "DEPT"; ?> </td>
<td class="admin_white" align="center"> <?php echo "MAC"; ?> </td>
<td class="admin_white" align="center"> <?php echo "ROOM NO"; ?> </td>
 
</tr>

<?php
while($request=mysql_fetch_assoc($result))
	{
	 
    if ($i) { $color="admin_white"; $i=0;}
    else {$color="admin_gray";$i=1;}
   

echo <<<EOC
<tr>
<td class="$color" align="center"><input type="checkbox" name="id[]" value="$request[con_no]"></td>
<td class="$color"> $request[uname] </td>
<td class="$color" align="center">$request[regno]</td>
<td class="$color" align="center">$request[dept]</td>
<td class="$color" align="center"> $request[mac]</td>
<td class="$color" align="center"> $request[room_no]</td>

</tr>

EOC;
} // End while
?>
</table>
</center>
</div>

<p>&nbsp; <a href="Javascript:void(0)" onClick="Javascript:hd_changeAll()"><?php echo $hdlang['chg_all']; ?></a></p>

<center><input type="submit" value="connected" class="button" name="a"></center></p>

</form>
 
 
